// 将数组中的 对象 扁平化
export function flattenNestedArray(arr: any[]): any[] {
	const result: any[] = [];

	function flatten(item: any) {
		result.push({ ...item });
		if (item.children) {
			item.children.forEach((child: any) => flatten(child));
		}
	}

	arr.forEach((item) => flatten(item));
	return result;
}
